package model

import (
	"gorm.io/gorm"
	"time"
)

type EduChapter struct {
	ID        int            `json:"id"`
	CourseID  int            `json:"course_id"`
	Title     string         `json:"title"`
	Sort      int            `json:"sort"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`

	Videos []EduVideo `gorm:"foreignKey:ChapterID;references:ID" json:"children"`
}

func (EduChapter) TableName() string {
	return "edu_chapter"
}
